package com.doit.demo03;

import java.util.function.Function;

public class test_Function {
    public static void main(String[] args) {
        //标准
        method("1000",(String num)->{
            return Integer.parseInt(num);
        } );
        //简化
        method("1000",num->Integer.parseInt(num) );
        //引用类型
        method("1234",Integer::parseInt );

    }
    public static void method(String s , Function<String,Integer>f){
        Integer apply = f.apply(s);//将s转换为integer类型
        System.out.println(apply);
    }
}
